<?php use yii\helpers\Html;
use common\components\helpers\Fun;
use common\components\helpers\Tree;?>
<div id="toolbar">
    <?= $this->renderFile('@app/views/layouts/toolbar.php'); ?>
    <fieldset>
        <legend>搜索</legend>
        <div>
           <?php $cate = Fun::cache('category_course_cache', false);$new_cate=(new Tree($cate))->get_tree_select();?>
            <?php if($category_id!=null){?>
            类别名称：<?= Html::dropDownList('category_id',$category_id, $new_cate,['prompt'=>'类别名称','encode'=>false,'class'=>'search','disabled' => true]); ?>
    <?php } else {?>
    类别名称：<?= Html::dropDownList('category_id',null, $new_cate,['prompt'=>'类别名称','encode'=>false,'class'=>'search']); ?>
    <?php }?>
            课程名称：<?= Html::textInput('title', null, ['class' => 'search input-text']); ?>
            <?= Html::button('搜索', ['id' => 'search-handle', 'class' => 'button']);?>
        </div>
    </fieldset>
</div>
<table id="data-load" class="easyui-datagrid" style="width: 100%"
       data-options="fitColumns:true,
       checkbox:true,
       rownumbers: true,
       singleSelect:false,
       idField: 'id',
       pagination:true,
       toolbar:'#toolbar'">
    <thead>
    <tr>
        <th data-options="field:'ck',checkbox:true,align:'center'"></th>
        <th data-options="field:'category_name',align:'center'"><?=\Yii::t('zhtfrontend','类别名称');?></th>
        <th data-options="field:'mechanic_name',align:'center'"><?=\Yii::t('zhtfrontend','所属机构');?></th>
        <th data-options="field:'course_name',align:'center'"><?=\Yii::t('zhtfrontend','课程名称');?></th>
        <th data-options="field:'teacher_name',align:'center'"><?=\Yii::t('zhtfrontend','教师名称');?></th>
        <th data-options="field:'room_number',align:'center'"><?=\Yii::t('zhtfrontend','教室编号');?></th>
        <th data-options="field:'class_day',align:'center'"><?=\Yii::t('zhtfrontend','上课星期');?></th>
        <th data-options="field:'start_time',align:'center'"><?=\Yii::t('zhtfrontend','上课时间');?></th>
        <th data-options="field:'end_time',align:'center'"><?=\Yii::t('zhtfrontend','下课时间');?></th>
        <th data-options="field:'class_count',align:'center'"><?=\Yii::t('zhtfrontend','上课次数');?></th>
        <th data-options="field:'max_number',align:'center'"><?=\Yii::t('zhtfrontend','满额人数');?></th>
        <th data-options="field:'opening_number',align:'center'"><?=\Yii::t('zhtfrontend','开班人数');?></th>
        <th data-options="field:'price',align:'center'"><?=\Yii::t('zhtfrontend','销售价');?></th>
    </tr>
    </thead>
</table>
<?= $this->renderFile('@app/views/layouts/script_data.php'); ?>